<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>&lt;GMarkupParseContext&gt;: </title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.2">
<link rel="home" href="index.html" title="">
<link rel="up" href="ch01.html" title="GLib">
<link rel="prev" href="re37.html" title="&lt;%GLibMarkupError&gt;">
<link rel="next" href="re39.html" title="&lt;%GLibMarkupParseFlags&gt;">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
<td><a accesskey="p" href="re37.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="re39.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="id-1.1.39"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>&lt;GMarkupParseContext&gt;</h2>
<p>&lt;GMarkupParseContext&gt;</p>
</div>
<div class="refsect1">
<a name="id-1.1.39.2"></a><h2>Description</h2>
<p>A parse context is used to parse a stream of bytes that
you expect to contain marked-up text.
</p>
<p>See <code class="function">g_markup_parse_context_new()</code>, <span class="type">GMarkupParser</span>, and so
on for more details.</p>
</div>
<div class="refsect1">
<a name="id-1.1.39.3"></a><h2>Functions</h2>
<div class="refsect2">
<a name="id-1.1.39.3.2"></a><h3>end-parse?</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (markup-parse-context:end-parse? self))
</pre></div>
<p>Signals to the <span class="type">GMarkupParseContext</span> that all data has been
fed into the parse context with <code class="function">g_markup_parse_context_parse()</code>.
</p>
<p>This function reports an error if the document isn't complete,
for example if elements are still open.</p>
<div class="refsect3">
<a name="id-1.1.39.3.2.5"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>context</p></td>
<td class="parameter_description">
<p>a <span class="type">GMarkupParseContext</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.39.3.3"></a><h3>free</h3>
<div class="informalexample"><pre class="programlisting">(define-values () (markup-parse-context:free self))
</pre></div>
<p>Frees a <span class="type">GMarkupParseContext</span>.
</p>
<p>This function can't be called from inside one of the
<span class="type">GMarkupParser</span> functions or while a subparser is pushed.</p>
<div class="refsect3">
<a name="id-1.1.39.3.3.5"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>context</p></td>
<td class="parameter_description">
<p>a <span class="type">GMarkupParseContext</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.39.3.4"></a><h3>get-element</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (markup-parse-context:get-element self))
</pre></div>
<p>Retrieves the name of the currently open element.
</p>
<p>If called from the start_element or end_element handlers this will
give the element_name as passed to those functions. For the parent
elements, see <code class="function">g_markup_parse_context_get_element_stack()</code>.</p>
<div class="refsect3">
<a name="id-1.1.39.3.4.5"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>context</p></td>
<td class="parameter_description">
<p>a <span class="type">GMarkupParseContext</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.39.3.5"></a><h3>get-position</h3>
<div class="informalexample"><pre class="programlisting">(define-values
  (line-number char-number)
  (markup-parse-context:get-position self))
</pre></div>
<p>Retrieves the current line number and the number of the character on
that line. Intended for use in error messages; there are no strict
semantics for what constitutes the "current" line number other than
"the best number we could come up with for error messages."</p>
<div class="refsect3">
<a name="id-1.1.39.3.5.4"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>context</p></td>
<td class="parameter_description">
<p>a <span class="type">GMarkupParseContext</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>line_number</p></td>
<td class="parameter_description">
<p>return location for a line number, or <code class="constant">NULL</code></p>
<p>Passed as <code class="code">line-number</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>char_number</p></td>
<td class="parameter_description">
<p>return location for a char-on-line number, or <code class="constant">NULL</code></p>
<p>Passed as <code class="code">char-number</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.39.3.6"></a><h3>get-user-data</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (markup-parse-context:get-user-data self))
</pre></div>
<p>Returns the user_data associated with <em class="parameter"><code>context</code></em>.
</p>
<p>This will either be the user_data that was provided to
<code class="function">g_markup_parse_context_new()</code> or to the most recent call
of <code class="function">g_markup_parse_context_push()</code>.</p>
<div class="refsect3">
<a name="id-1.1.39.3.6.5"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>context</p></td>
<td class="parameter_description">
<p>a <span class="type">GMarkupParseContext</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.39.3.7"></a><h3>parse?</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (markup-parse-context:parse? self text text-len))
</pre></div>
<p>Feed some data to the <span class="type">GMarkupParseContext</span>.
</p>
<p>The data need not be valid UTF-8; an error will be signaled if
it's invalid. The data need not be an entire document; you can
feed a document into the parser incrementally, via multiple calls
to this function. Typically, as you receive data from a network
connection or file, you feed each received chunk of data into this
function, aborting the process if an error occurs. Once an error
is reported, no further data may be fed to the <span class="type">GMarkupParseContext</span>;
all errors are fatal.</p>
<div class="refsect3">
<a name="id-1.1.39.3.7.5"></a><h4>Parameters</h4>
<div class="informaltable"><table>
<tr>
<td class="parameter_name"><p>context</p></td>
<td class="parameter_description">
<p>a <span class="type">GMarkupParseContext</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>text</p></td>
<td class="parameter_description">
<p>chunk of text to parse</p>
<p>Passed as <code class="code">text</code></p>
</td>
</tr>
<tr>
<td class="parameter_name"><p>text_len</p></td>
<td class="parameter_description">
<p>length of <em class="parameter"><code>text</code></em> in bytes</p>
<p>Passed as <code class="code">text-len</code></p>
</td>
</tr>
</table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.39.3.8"></a><h3>pop</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (markup-parse-context:pop self))
</pre></div>
<p>Completes the process of a temporary sub-parser redirection.
</p>
<p>This function exists to collect the user_data allocated by a
matching call to <code class="function">g_markup_parse_context_push()</code>. It must be called
in the end_element handler corresponding to the start_element
handler during which <code class="function">g_markup_parse_context_push()</code> was called.
You must not call this function from the error callback -- the
<em class="parameter"><code>user_data</code></em> is provided directly to the callback in that case.
</p>
<p>This function is not intended to be directly called by users
interested in invoking subparsers. Instead, it is intended to
be used by the subparsers themselves to implement a higher-level
interface.</p>
<div class="refsect3">
<a name="id-1.1.39.3.8.6"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>context</p></td>
<td class="parameter_description">
<p>a <span class="type">GMarkupParseContext</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.39.3.9"></a><h3>ref</h3>
<div class="informalexample"><pre class="programlisting">(define-values (%return) (markup-parse-context:ref self))
</pre></div>
<p>Increases the reference count of <em class="parameter"><code>context</code></em>.</p>
<div class="refsect3">
<a name="id-1.1.39.3.9.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>context</p></td>
<td class="parameter_description">
<p>a <span class="type">GMarkupParseContext</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
<div class="refsect2">
<a name="id-1.1.39.3.10"></a><h3>unref</h3>
<div class="informalexample"><pre class="programlisting">(define-values () (markup-parse-context:unref self))
</pre></div>
<p>Decreases the reference count of <em class="parameter"><code>context</code></em>.  When its reference count
drops to 0, it is freed.</p>
<div class="refsect3">
<a name="id-1.1.39.3.10.4"></a><h4>Parameters</h4>
<div class="informaltable"><table><tr>
<td class="parameter_name"><p>context</p></td>
<td class="parameter_description">
<p>a <span class="type">GMarkupParseContext</span></p>
<p>Passed as <code class="code">self</code></p>
</td>
</tr></table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>
